<%@ include file="/include/taglibs.jsp"%>
<%@ page contentType="text/html; charset=UTF-8"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="${ctx}/css/menuGrey.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${ctx}/script/JBF/button.js"></script>
<script type="text/javascript" src="${ctx}/script/menu.js"></script>
</head>
<body>
	<div style="width:150px;border: solid 1px #E6E6E6;padding:0px; margin:0px;">
		<div class='menuTitle'><div class='titleText'>账户中心</div></div>
		<div class='balancePanel'>
			<div class="subBalancePanel">
				<div>可用余额：<b id="balance">10.00</b></div>
				<div class="fullMoneyBtn"><a href="#">立即充值</a></div>
			</div>
		</div>
		<div style="border:none width:100%;" id="menuDiv" name="menuDiv"></div>
	</div>
</body>
<script type="text/javascript">
	function linkFun(url){
		window.location.href=url;
	}
	(function buildMenuTree() {
		 //var menuList = msg.pageList;
		 var menusData = {
		 showType : "",
		 cssStyle : "",
		 datas : [ {
				showName : "我的交易",
				code : "00001",
				url : "www.baidu.com",
				subNodes : [ {
					showName : "我的购物车",
					code : "000012",
					url : "${ctx}/buycar/buycarAction!gotoBuyCarGoods.action"
				}, {
					showName : "我的订单",
					code : "000012",
					url : "${ctx}/orderinfo/orderforminfoAction!searchMyOrderInfo.action"
				}, {
					showName : "我的包裹",
					code : "000012",
					url : "${ctx}/packageinfo/packageinfoAction!initSearchPackageinfo.action"
				} , {
					showName : "国内送礼",
					code : "000012",
					url : "www.qq.com.cn"
				}, {
					showName : "自助购",
					code : "000012",
					url : "www.qq.com.cn"
				} , {
					showName : "交易记录",
					code : "000012",
					url : "www.qq.com.cn"
				}   ]
			}, {
				showName : "客户服务",
				code : "00002",
				url : "www.baidu.com",
				subNodes : [ {
					showName : "我要咨询/回复",
					code : "000021",
					url : "www.sina.com.cn"
				}, {
					showName : "我要投诉",
					code : "000022",
					url : "www.qq.com.cn"
				}, {
					showName : "短消息(4)",
					code : "000022",
					url : "www.qq.com.cn"
				}, {
					showName : "我的评论",
					code : "000022",
					url : "www.qq.com.cn"
				} ]
			}, {
				showName : "账号管理",
				code : "00002",
				url : "www.baidu.com",
				subNodes : [ {
					showName : "个人信息",
					code : "000021",
					url : "www.sina.com.cn"
				}, {
					showName : "我的积分",
					code : "000022",
					url : "www.qq.com.cn"
				}, {
					showName : "我的优惠卡",
					code : "000022",
					url : "www.qq.com.cn"
				}, {
					showName : "邀请朋友(奖现金)",
					code : "000022",
					url : "www.qq.com.cn"
				} ]
			} ],
		 linkFun:linkFun
		 };
		 menu=new LeftMenu(menusData,"menu");
		 JBF.el("menuDiv").innerHTML=menu.show();
	 //注：将datas:menuList;来代替现有的datas节点的值
	 })();
		function selectMenuByCode(code){
			menu.selectedMenu("000021");
		}
		selectMenuByCode();
		function continueBuy(){
			var ajaxUrl="${ctx}/user/systemUserAction!ajaxUserHasLogin.action";
			$.ajax({
				type: "post",
				url: ajaxUrl,
				dataType: "text",
				data:{"timeTemp":new Date().getTime()},   
				success: function(data){
					  if(data=='02'){//未登录
						  $.openPopupLayer({
								name: "quickLogin",
								width: 1050,
								parameters: {"TimeFlags":Date.parse(new Date())},
								url: "${ctx}/user/systemUserAction!gotoQuickLogin.action"
							});
					  }else{//已登录
									  $.openPopupLayer({
										name: "showGoodDiv",
										width: 1050,
										//target: "sendblessDiv",
										parameters: {"TimeFlags":Date.parse(new Date())},
										url: "${ctx}/buycar/buycarAction!continueBuyGood.action"
						  });
					  }
					}
			});
		}	
//获取账户信息
$(document).ready(function(){
	//获取购物车商品数量
	var name="${loginuser.username}";
	if(name!=null && name!=''){
		var ajaxUrl="${ctx}/account/accountAction!ajaxForMyAccount.action";
		$.ajax({
			type: "post",
			url: ajaxUrl,
			dataType: "json",
			data:{"timeTemp":new Date().getTime()},   
			success: function(data){
				  if(data!=null && data!=''){
					  //设值
					     $("#balance").html(data.balance);
				  }
				}
			});
	}
});
</script>
</html>